package com.example.wechat.model;

import java.time.LocalDateTime;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import com.example.project.annotation.Excel;
import com.example.project.core.domain.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;

/**
 * 微信聊天消息对象 t_wechat_message
 * 
 * @author ruoyi
 * @date 2025-11-12
 */
public class WechatMessage extends BaseEntity {

	private static final long serialVersionUID = 1L;

	/** 消息ID */
	private Long id;

	/** 所属会话ID */
	@Excel(name = "所属会话ID")
	private Long conversationId;

	/** 发送者用户ID */
	@Excel(name = "发送者用户ID")
	private Long fromUser;

	/** 群聊ID（群聊时） */
	@Excel(name = "群聊ID", readConverterExp = "群=聊时")
	private Long groupId;

	/** 消息类型（1：文本，2：图片，3：文件，4：语音，5：视频，6：系统消息） */
	@Excel(name = "消息类型", readConverterExp = "1=：文本，2：图片，3：文件，4：语音，5：视频，6：系统消息")
	private Integer messageType;

	/** 消息内容 */
	@Excel(name = "消息内容")
	private String content;

	/** 文件URL（图片、文件、语音、视频等） */
	@Excel(name = "文件URL", readConverterExp = "图=片、文件、语音、视频等")
	private String fileUrl;

	/** 文件名 */
	@Excel(name = "文件名")
	private String fileName;

	/** 文件大小（字节） */
	@Excel(name = "文件大小", readConverterExp = "字=节")
	private Long fileSize;

	/** 图片宽度 */
	@Excel(name = "图片宽度")
	private Integer imageWidth;

	/** 图片高度 */
	@Excel(name = "图片高度")
	private Integer imageHeight;

	/** 语音时长（秒） */
	@Excel(name = "语音时长", readConverterExp = "秒=")
	private Long voiceDuration;

	/** 视频时长（秒） */
	@Excel(name = "视频时长", readConverterExp = "秒=")
	private Long videoDuration;

	/** 是否已读（0：未读，1：已读） */
	@Excel(name = "是否已读", readConverterExp = "0=：未读，1：已读")
	private Integer isRead;

	/** 是否撤回（0：正常，1：已撤回） */
	@Excel(name = "是否撤回", readConverterExp = "0=：正常，1：已撤回")
	private Integer isRecalled;

	/** 消息状态：0-发送中 1-发送成功 2-发送失败 */
	@Excel(name = "消息状态：0-发送中 1-发送成功 2-发送失败")
	private Integer status;

	/** 发送时间 */
	@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
	@Excel(name = "发送时间", width = 30, dateFormat = "yyyy-MM-dd")
	private LocalDateTime sendTime;

	/** 阅读时间 */
	@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
	@Excel(name = "阅读时间", width = 30, dateFormat = "yyyy-MM-dd")
	private LocalDateTime readTime;

	/** 撤回时间 */
	@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
	@Excel(name = "撤回时间", width = 30, dateFormat = "yyyy-MM-dd")
	private LocalDateTime recallTime;

	/** 删除标志（0：正常，1：删除） */
	private Integer delFlag;

	public void setId(Long id) {
		this.id = id;
	}

	public Long getId() {
		return id;
	}

	public void setConversationId(Long conversationId) {
		this.conversationId = conversationId;
	}

	public Long getConversationId() {
		return conversationId;
	}

	public void setFromUser(Long fromUser) {
		this.fromUser = fromUser;
	}

	public Long getFromUser() {
		return fromUser;
	}

	public void setGroupId(Long groupId) {
		this.groupId = groupId;
	}

	public Long getGroupId() {
		return groupId;
	}

	public void setMessageType(Integer messageType) {
		this.messageType = messageType;
	}

	public Integer getMessageType() {
		return messageType;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public String getContent() {
		return content;
	}

	public void setFileUrl(String fileUrl) {
		this.fileUrl = fileUrl;
	}

	public String getFileUrl() {
		return fileUrl;
	}

	public void setFileName(String fileName) {
		this.fileName = fileName;
	}

	public String getFileName() {
		return fileName;
	}

	public void setFileSize(Long fileSize) {
		this.fileSize = fileSize;
	}

	public Long getFileSize() {
		return fileSize;
	}

	public void setImageWidth(Integer imageWidth) {
		this.imageWidth = imageWidth;
	}

	public Integer getImageWidth() {
		return imageWidth;
	}

	public void setImageHeight(Integer imageHeight) {
		this.imageHeight = imageHeight;
	}

	public Integer getImageHeight() {
		return imageHeight;
	}

	public void setVoiceDuration(Long voiceDuration) {
		this.voiceDuration = voiceDuration;
	}

	public Long getVoiceDuration() {
		return voiceDuration;
	}

	public void setVideoDuration(Long videoDuration) {
		this.videoDuration = videoDuration;
	}

	public Long getVideoDuration() {
		return videoDuration;
	}

	public void setIsRead(Integer isRead) {
		this.isRead = isRead;
	}

	public Integer getIsRead() {
		return isRead;
	}

	public void setIsRecalled(Integer isRecalled) {
		this.isRecalled = isRecalled;
	}

	public Integer getIsRecalled() {
		return isRecalled;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	public Integer getStatus() {
		return status;
	}

	public void setSendTime(LocalDateTime sendTime) {
		this.sendTime = sendTime;
	}

	public LocalDateTime getSendTime() {
		return sendTime;
	}

	public void setReadTime(LocalDateTime readTime) {
		this.readTime = readTime;
	}

	public LocalDateTime getReadTime() {
		return readTime;
	}

	public void setRecallTime(LocalDateTime recallTime) {
		this.recallTime = recallTime;
	}

	public LocalDateTime getRecallTime() {
		return recallTime;
	}

	public void setDelFlag(Integer delFlag) {
		this.delFlag = delFlag;
	}

	public Integer getDelFlag() {
		return delFlag;
	}

	@Override
	public String toString() {
		return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).append("id", getId())
				.append("conversationId", getConversationId()).append("fromUser", getFromUser())
				.append("groupId", getGroupId()).append("messageType", getMessageType()).append("content", getContent())
				.append("fileUrl", getFileUrl()).append("fileName", getFileName()).append("fileSize", getFileSize())
				.append("imageWidth", getImageWidth()).append("imageHeight", getImageHeight())
				.append("voiceDuration", getVoiceDuration()).append("videoDuration", getVideoDuration())
				.append("isRead", getIsRead()).append("isRecalled", getIsRecalled()).append("status", getStatus())
				.append("sendTime", getSendTime()).append("readTime", getReadTime())
				.append("recallTime", getRecallTime()).append("createTime", getCreateTime())
				.append("updateTime", getUpdateTime()).append("delFlag", getDelFlag()).toString();
	}
}
